package com.rongc.client.freight.base.view.widget;

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
 * Created by Bruce on 2016/11/25.
 */
public class SpaceItemDecoration extends RecyclerView.ItemDecoration{

    private int space;
    private int vspace;

    public SpaceItemDecoration(int space) {
        this.space = space;
        this.vspace = space;
    }

    public SpaceItemDecoration(int space, int vspace) {
        this.space = space;
        this.vspace = vspace;
    }

    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {

            outRect.top = space;
            outRect.left = vspace;
            outRect.right = vspace;
            outRect.bottom = space;
    }
}
